package com.jacobson.huobi.mvp.contract

import com.alibaba.fastjson.JSONObject
import com.jacobson.core.mvp.IModel
import com.jacobson.core.mvp.IPresenter
import com.jacobson.core.mvp.IView
import com.jacobson.huobi.entities.LoginUserInfo
import com.jacobson.huobi.entities.RegisterInfo
import com.jacobson.huobi.entities.response.CommonResponse
import com.jacobson.huobi.entities.response.LoginPageResponse
import io.reactivex.Observable

interface LoginContract {
    interface Model : IModel {
        fun getVertiCode(
            phone: String
        ): Observable<LoginPageResponse>

        fun registerUser(
            registerInfo: RegisterInfo
        ): Observable<LoginPageResponse>

        fun getKaptcha(
        ): Observable<CommonResponse<JSONObject>>

        fun login(loginUserInfo: LoginUserInfo): Observable<CommonResponse<JSONObject>>

    }

    interface View : IView {
        fun onVertiCodeResultResp(response: LoginPageResponse)

        fun onRegisterResultResp(response: LoginPageResponse)

        fun onGetKaptchaResultResp(response: CommonResponse<JSONObject>)

        fun onLoginResultResp(response: CommonResponse<JSONObject>)

    }

    interface Presenter : IPresenter {
        fun getVertiCode(
            phone: String
        )

        fun registerUser(
            registerInfo: RegisterInfo
        )

        fun getKaptcha(
        )

        fun login(loginUserInfo: LoginUserInfo)

    }
}